{template 'common/header'}
{php load()->func('tpl');}
<script type="text/javascript" src="../addons/meepo_weixiangqin/template/jquery-1.7.2.min.js"></script>
<script>
	function selectall(obj, name){
		$('input[name="'+name+'[]"]:checkbox').each(function() {
			$(this).attr("checked", $(obj).attr('checked') ? true : false);
		});
	}
</script>
<ul class="nav nav-tabs">
	<li {if $_GPC['status'] == 0} class="active"{/if}><a href="{php echo $this->createWebUrl('photolist', array('id' => $id, 'status' => 0))}">待审核</a></li>
	<li {if $_GPC['status'] == 1} class="active"{/if}><a href="{php echo $this->createWebUrl('photolist', array('id' => $id, 'status' => 1))}">已审核</a></li>
	<li><a href="{php echo $this->createWebUrl('payrecord')}">充值记录</a></li>
	<li><a href="{php echo $this->createWebUrl('baoyuerecord')}">包月记录</a></li>
	<li><a href="{php echo $this->createWebUrl('Exchangerecord')}">兑换记录</a></li>
	<li><a href="{php echo $this->createWebUrl('tjapply')}">推荐记录</a></li>
    <li><a href="{php echo $this->createWebUrl('set')}">基本设置</a></li>
</ul>
<div class="panel panel-default">

	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="meepo_weixiangqin" />
			<input type="hidden" name="do" value="photolist" />
			<input type="hidden" name="status" value="{$status}" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">上传图片粉丝昵称</label>
				<div class="col-xs-12 col-sm-8 col-lg-9">
					<input class="form-control" name="nickname" value="{$nickname}" type="text"  placeholder="请输入上传图片粉丝昵称">
				</div>
			</div>
			<div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">支付时间</label>
                <div class="col-xs-12 col-sm-8 col-lg-9">
               	
				{php echo tpl_form_field_daterange('datelimit', array('starttime'=>empty($starttime) ? date('Y-m-d',time()) : date('Y-m-d',$starttime),'endtime'=>empty($endtime) ? date('Y-m-d',time()+3600*240) : date('Y-m-d',$endtime)))}
				
               </div>
           </div>
			<div class="form-group">
				<div class=" col-xs-12 col-sm-2 col-lg-2">
					<input type="submit"  value="搜索" class="btn btn-success  btn-block" />
				</div>
			</div>

		</form>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading">
		{if $_GPC['status'] == 0}待审核图片{/if}
		{if $_GPC['status'] == 1}已审核图片{/if}
	</div>
	<div class="panel-body">
		<div class="main" id="table-list">
			<form action="" method="post" onsubmit="">
				<div class="table-responsive">
					<table class="table table-hover">
						<thead class="navbar-inner">
						<tr>
							<th style="width:10%;" class="row-first">选择</th>
							<th style="width:10%;">粉丝昵称<i></i></th>
							<th class="row-hover" style="width:20%">上传时间<i></i></th>
							<th style="width:40%;">图片链接</th>
							<th style="width:20%;"><i></i></th>
							
						</tr>
						</thead>
						<tbody>
						{loop $list $row}
						<tr>
							<td class="row-first"><input type="checkbox" name="select[]" value="{$row['id']}" /></td>
							<td class="row-hover">
								
								<div class="mainContent">
									<div class="nickname"><a href="{php echo $this->createWebUrl('list', array('keyword' =>$userinfo[$row['from_user']]['nickname'] , 'isshow' =>'1'))}">{$userinfo[$row['from_user']]['nickname']}</a></div>
								</div>
							</td>
							<td>
					            <div style="margin-bottom:10px;">{php echo date('Y-m-d', $row['time']);}</div>
								<div>{php echo date('H:i:s', $row['time']);}</div>
					</td>
							<td>
							{$row['url']}
							</td>
							<td style="font-size:12px; color:#666;">
								<div style="margin-bottom:10px;"><img src="{$_W['attachurl']}{$row['url']}" height=100px width=100px></div>
							</td>
							
						</tr>
						{/loop}
						</tbody>
					</table>
					{if !empty($list)}
					<table class="table">
						<tr>
							<td style="width:50px;" class="row-first"><input type="checkbox" onclick="selectall(this, 'select');" /></td>
							<td colspan="4">
								{if $_GPC['status'] == 0}
								<input type="submit" name="verify" value="审核" class="btn btn-primary" />
								{/if}
								<input type="submit" name="delete" value="删除" class="btn btn-primary" />
								<input type="hidden" name="token" value="{$_W['token']}" />
							</td>
						</tr>
					</table>
					{/if}
					{$pager}
				</div>
			</form>
		</div>
	</div>
</div>
<script>
require(['jquery'], function($){
	//详细数据相关操作
	var tdIndex;
	$("#table-list thead").delegate("th", "mouseover", function(){
		if($(this).find("i").hasClass("")) {
			$("#table-list thead th").each(function() {
				if($(this).find("i").hasClass("icon-sort")) $(this).find("i").attr("class", "");
			});
			$("#table-list thead th").eq($(this).index()).find("i").addClass("icon-sort");
		}
	});
	$("#table-list thead th").click(function() {
		if($(this).find("i").length>0) {
			var a = $(this).find("i");
			if(a.hasClass("icon-sort") || a.hasClass("icon-caret-up")) { //递减排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-down");
			} else if(a.hasClass("icon-caret-down")) { //递增排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-up");
			}
			$("#table-list thead th,#table-list tbody:eq(0) td").removeClass("row-hover");
			$(this).addClass("row-hover");
			tdIndex = $(this).index();
			$("#table-list tbody:eq(0) tr").each(function() {
				$(this).find("td").eq(tdIndex).addClass("row-hover");
			});
		}
	});
});
</script>


{template 'common/footer'}